<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    input {
      width: 400px;
      height: 40px;
      font-size: 20px;
    }
  </style>
</head>

<body>
  <input type="text">
</body>
<script>
  let input = document.querySelector('input')
  input.addEventListener('input', cooling(() => {
    console.log(input.value);
  }, 1000))
  function cooling(fun, time) {
    var flag = true
    return function () {
      if (!flag) {
        return false
      }
      flag = false
      setTimeout(() => {
        fun()
        flag = true
      }, time)
    }

  }
</script>

</html>